package com.bops.service;

import java.util.HashMap;
import java.util.List;


import com.bops.dal.product.dao.ProductsDAO;
import com.bops.dal.product.dao.Type1DAO;
import com.bops.dal.product.dao.Type2DAO;
import com.bops.dal.product.dao.Type3DAO;
import com.bops.dal.product.dataobject.ProductsDO;
import com.bops.dal.product.dataobject.TypeOne;
import com.bops.dal.product.dataobject.TypeThree;
import com.bops.dal.product.dataobject.TypeTwo;
import com.bops.dal.product.queryobject.ProductsQuery;
import com.bops.dal.product.queryobject.TypeOneQuery;
import com.bops.dal.product.queryobject.TypeThreeQuery;
import com.bops.dal.product.queryobject.TypeTwoQuery;

public class ProductService {

	private Type1DAO type1Dao;
	private Type2DAO type2Dao;
	private Type3DAO type3Dao;
	private ProductsDAO productDao;
	
	
	public Integer insertProduct(ProductsDO record){
		return productDao.insertProduct(record);
	}

    public int updateProduct(ProductsDO record){
    	return productDao.updateProduct(record);
    }

    public List<ProductsDO> listProduct(ProductsQuery query){
    	return productDao.listProduct(query);
    }
    
    
    public List<ProductsDO> completeProduct(ProductsQuery query){
    	return productDao.completeProduct(query);
    }

    public  ProductsDO findProduct_cloud_ById(Integer id){
    	return productDao.findProduct_cloud_ById(id);
    }
    
    public  ProductsDO findProductById(Integer id){
    	return productDao.findProductById(id);
    }
    
    public ProductsDO findProductIDByName(ProductsQuery queryProduct){
    	return productDao.findProductIDByName(queryProduct);
    }

    public int deleteProductById(Integer id){
    	return productDao.deleteProductById(id);
    }

    public int countProduct(HashMap<String,Object> map){
    	return productDao.countProduct(map);
    }
    
    public int checkProduct(ProductsDO editProduct){
    	return productDao.checkProduct(editProduct);
    }
	
	
	public void insertType3(TypeThree record){
		type3Dao.insertType3(record);
	}

    public int updateType3(TypeThree record){
    	return type3Dao.updateType3(record);
    }

    public List<TypeThree> listType3(TypeThreeQuery query){
    	return type3Dao.listType3(query);
    }
    
    List<TypeThree> completeType3(TypeThreeQuery query){
    	return type3Dao.completeType3(query);
    }

    public TypeThree findType3ById(Integer id){
    	return type3Dao.findType3ById(id);
    }
    
    public TypeThree findType3IDByName(TypeThreeQuery queryType3){
    	return type3Dao.findType3IDByName(queryType3);
    }

    public int deleteType3ById(Integer id){
    	return type3Dao.deleteType3ById(id);
    }

    public int countType3(HashMap<String,Object> map){
    	return  type3Dao.countType3(map);
    }
    
    public int checkType3Name( TypeThree editType3){
    	return type3Dao.checkType3Name(editType3);
    }
	
	
	public int countType1(HashMap<String, Object> map){
		return type1Dao.countType1(map);
	}
	
	public int deleteType1ById(Integer id){
		return type1Dao.deleteType1ById(id);
	}
	
	public TypeOne findType1ById(Integer id){
		return type1Dao.findType1ById(id);
	}
	
	public TypeOne findIDByName(String name){
		return type1Dao.findIDByName(name);
	}
	
	public boolean insertType1(TypeOne editType1){
		return type1Dao.insertType1(editType1);
	}
	
	public int updateType1(TypeOne editType1){
		return type1Dao.updateType1(editType1);
	}
	
	public List<TypeOne> listType1(TypeOneQuery queryType1){
		return type1Dao.listType1(queryType1);
	}
	
	public List<TypeOne> completeType1(TypeOneQuery queryType1){
		return type1Dao.completeType1(queryType1);
	}
	
	public int checkType1Name(TypeOne editType1 ){
		return type1Dao.checkType1Name(editType1);
	}
	
	
	public void setType1Dao(Type1DAO type1Dao) {
		this.type1Dao = type1Dao;
	}
	public void setType2Dao(Type2DAO type2Dao) {
		this.type2Dao = type2Dao;
	}
	
	public void insertType2(TypeTwo record){
		type2Dao.insertType2(record);
	}

    public int updateType2(TypeTwo record){
    	return type2Dao.updateType2(record);
    }

    public List<TypeTwo> listType2(TypeTwoQuery query){
    	return type2Dao.listType2(query);
    }
    
    public List<TypeTwo> completeType2(TypeTwoQuery query){
    	return type2Dao.completeType2(query);
    }

    public TypeTwo findType2ById(Integer id){
    	return type2Dao.findType2ById(id);
    }
    
    public TypeTwo findType2IDByName(TypeTwoQuery queryType2){
    	return type2Dao.findType2IDByName(queryType2);
    }

    public int deleteType2ById(Integer id){
    	return type2Dao.deleteType2ById(id);
    }

    public int countType2(HashMap<String,Object> map){
    	return type2Dao.countType2(map);
    }
    
    public int checkType2Name(TypeTwo editType2){
    	return type2Dao.checkType2Name(editType2);
    }

	public void setType3Dao(Type3DAO type3Dao) {
		this.type3Dao = type3Dao;
	}

	public void setProductDao(ProductsDAO productDao) {
		this.productDao = productDao;
	}
}
